#ifndef DW_GRAFFITI_MATRIX_STACK_INL
#	define DW_GRAFFITI_MATRIX_STACK_INL

namespace dw {
	namespace graffiti {

inline MatrixStack::MatrixStack(dw::uint32 capacity)
:	m_stack()
,	m_capacity(capacity)
{
	m_stack.push(glm::mat4(1.0f));
}

inline MatrixStack::~MatrixStack()
{
	dwAssert(m_stack.size() == 1, "MatrixStack is not empty");
}

inline void MatrixStack::push()
{
	dwAssert(m_stack.size() < m_capacity, "MatrixStack is full");

	m_stack.push(m_stack.top());
}

inline void MatrixStack::push(const glm::mat4& mat)
{
	dwAssert(m_stack.size() < m_capacity, "MatrixStack is full");

	m_stack.push(mat);
}

inline void MatrixStack::pop()
{
	m_stack.pop();
}

inline void MatrixStack::set(const glm::mat4& mat)
{
	m_stack.top() = mat;
}

inline void MatrixStack::mult(const glm::mat4& mat)
{
	m_stack.top() = m_stack.top() * mat;
}

inline const glm::mat4& MatrixStack::top() const
{
	return m_stack.top();
}

	} // namespace graffiti
} // namespace dw

#endif // !DW_GRAFFITI_MATRIX_STACK_INL
